Creating PVM Policy Import Schedulers
Overview
This page covers the Cloud Scheduler setup for the PVM Policy Import.
For a full operator walkthrough, see Running a PVM Policy Import End to End.
Preparation
- Bucket name is
biddirect-2.appspot.comand this may vary across environments. - The fleet file should be uploaded to
imports/fileDrop/before starting the import. - Set
leaseIdandleaseCompanyNamefor the target lease company. - Ensure sub-customers exist in ViSN if you rely on
location(Purchase Location Code) matching.
Validation
Validation can be run separately if required, but it is not part of the import order. When an import scheduler is run, validation is performed as part of that import.
Fleet File Validation
- Go to Cloud Scheduler and select CREATE JOB.
Setup
A scheduler should be created with the following parameters.
- Name: pvm_policy_fleet_file_validation
- Region: europe-west2
- Frequency: 0 0 31 12 1
- TimeZone: GMT London
- Target type: HTTP
- URL: https://import-manager-36r2bu4izq-uc.a.run.app/policy-import
- HTTP method: POST
- Auth header: select OIDC token
- Service account: cloud-run-import-customer-contract
- Body: a JSON object including the following parameters
JSON object for fleet validation scheduler
{
"leaseId": "<leaseId>",
"leaseCompanyName": "<leaseCompanyName>",
"persist": "false",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "pvmFleetFile.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com",
"schema": "PVM_POLICY_FLEET_FILE"
}
Fleet File Import
- Go to Cloud Scheduler and select CREATE JOB.
Setup
A scheduler should be created with the following parameters.
- Name: pvm_policy_fleet_file_import
- Region: europe-west2
- Frequency: 0 0 31 12 1
- TimeZone: GMT London
- Target type: HTTP
- URL: https://import-manager-36r2bu4izq-uc.a.run.app/policy-import
- HTTP method: POST
- Auth header: select OIDC token
- Service account: cloud-run-import-customer-contract
- Body: a JSON object including the following parameters
JSON object for fleet import scheduler
{
"leaseId": "<leaseId>",
"leaseCompanyName": "<leaseCompanyName>",
"persist": "true",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "pvmFleetFile.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com",
"schema": "PVM_POLICY_FLEET_FILE",
"reimportAll": "false",
"shouldTerminate": "false"
}
Optional body fields
| Field | Values | Purpose |
|---|---|---|
reimportAll | "true" / "false" | When true, re-import all merged rows to Firestore (not delta-only). |
shouldTerminate | "true" / "false" | When true, terminate vehicles missing from the processed fleet file. |
Import-manager validates the file (including sub-customer matching), writes pvmFleetFile_valid.csv and pvmFleetFile_processed.csv to GCS, and enqueues queue-services (PROCESS_PVM_POLICY_IMPORT) to import stock into Firestore.
Status: Pending Approval
Category: Protected
Authored By: Aditya on Jul 16, 2026